class Solution:
    def peakIndexInMountainArray(self, A):
        """
        :type A: List[int]
        :rtype: int
        """
        index, start , end =0, 0 , len(A)-1
        while start <= end:
            index = (start+end)/2
            if A[index-1]<A[index] and A[index]>A[index+1]:
                break
            elif A[index-1]>A[index] and A[index]>A[index+1]:
                end = index
            else:
                start = index 
        return index 


s = Solution()
s.peakIndexInMountainArray([0,1,0])